#include <stdio.h>

int main(){
	int ar[10];
	int n = sizeof(ar) / sizeof(ar[0]);

	FILE *fp = fopen("Test2.txt", "rb");
	if (fp == NULL)
	{
		printf("Open Test2.txt file Fail.\n");
		return -1;
	}

	fread(ar, sizeof(int), n, fp);

	fclose(fp);
	return 0;
}

/*
int main(){
	int ar[] = { 12, 23, 34, 45, 56, 67, 78, 89, 90, 100 };
	int n = sizeof(ar) / sizeof(ar[0]);

	FILE *fp = fopen("Test2.txt", "wb");
	if (fp == NULL)
	{
		printf("Open Test2.txt file Fail.\n");
		return -1;
	}

	fwrite(ar, sizeof(int), n, fp);

	fclose(fp);
	return 0;
}

/*
int main(){
	int ar[10];
	int n = sizeof(ar) / sizeof(ar[0]);

	FILE *fp = fopen("Test1.txt", "r");
	if (fp == NULL)
	{
		printf("Open Test1.txt file Fail.\n");
		return -1;
	}

	for (int i = 0; i < n; ++i)
		fscanf(fp, "%d ", &ar[i]);

	fclose(fp);
	return 0;
}

/*
int main(){
	int ar[] = { 12, 23, 34, 45, 56, 67, 78, 89, 90, 100 };
	int n = sizeof(ar) / sizeof(ar[0]);

	FILE *fp = fopen("Test1.txt","w");
	if (fp == NULL)
	{
		printf("Open Test1.txt file Fail.\n");
		return -1;
	}

	for (int i = 0; i < n; ++i)
		fprintf(fp, "%d ", ar[i]);

	fclose(fp);
	return 0;
}
*/